Learn R Programming

DescTools (version 0.99.16)

Datasets for Simulation: Datasets for Simulation

Description

For performing elementary probability calculations in introductory courses there are some datasets available. The dataset roulette contains the standard sample space for one spin on a roulette wheel. cards contain the standard set of 52 playing cards in four colours. tarot does the same with a classic tarot deck.

Usage

cards
tarot
roulette

Arguments

Value

  • cards is a data.frame with two columns named rank and suit tarot is a data.frame with three columns named rank, suit and desc roulette is a data.frame with two columns named num and col

Examples

Run this code
head(cards)
head(tarot)
head(roulette)

# drawing 5 cards
sample(do.call(paste, cards), 5)

# spin the wheel
sample(do.call(paste, roulette), 1)

# simulate the evening in Las Vegas
sample(do.call(paste, roulette), 32, replace=TRUE)

Run the code above in your browser using DataLab